export const xFormat = (str) => {
  const reg1 = /^(\d{4})-(\d{2})-(\d{2})$/;
  const reg2 = /^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2})$/;
  const reg3 = /^(\d{4})-(\d{1,2})月$/;
  const reg4 = /^(\d{4})-(\d{2})$/;
  const reg5 = /^(\d{1}):(\d{2})$/;
  if (reg1.test(str)) {
    const arr = str.split('-');
    return arr[1] + '-' + arr[2];
  }
  if (reg2.test(str)) {
    const arr = str.split(' ');
    return arr[1];
  }
  if (reg3.test(str)) {
    const arr = str.split('-');
    return arr[1];
  }
  if (reg4.test(str)) {
    const arr = str.split('-');
    return arr[1] + '月';
  }
  if (reg5.test(str)) {
    return '0' + str;
  }
  return str;
};
